	<?php $this->load->view('admin/partials/bid_menu'); ?>
	<?php 
		$ci = &get_instance();
		
	?>
	<h3>Bid &raquo; <?php echo ucfirst($this->uri->segment(4,''));?></h3>

	<div class="clrboth"></div>
	
	<?php $this->load->view('admin/bid/search_partial' ); ?>
	<div class="clrboth"></div>
	
	<table border="0" class="table-list">
		<thead>
			<tr>
				<th>Bid ref</th>
				<th>Buyer</th>
				<th>Seller</th>
				<th>Bids on show</th>
				<th>Show name</th>
				<th>Artist</th>
				<th>Bid date</th>
			</tr>
		</thead>
		
		<tbody>
			<?php foreach( $items['items'] as $item ): ?>
			<?php 
				$BUYER = clone_( $ci->user_entity->init('acc_code',$item->account_code));
				$SHOW = $ci->show_entity->init('ref_no',$item->show_ref_no);
				$SELLER = $ci->user_entity->init('id',$SHOW->getUserCreatedId());
				$numberBidShow = $SHOW->countHowManyUserBidThisShow() > 0 ? "( ".$SHOW->countHowManyUserBidThisShow()." )": '';
			?>
			<tr>
				<td><a href="javascript:void(0);" onclick="_openDialogBidInfo(<?php echo $item->id;?>)"><?php echo $item->id; ?></a></td>
				<td><a href="javascript:void(0);" onclick="_openDialogBuyerInfo(<?php echo $BUYER->getId();?>)"><?php echo $BUYER->getFirstName()." ".$BUYER->getLastName(); ?></a></td>
				<td><a href="javascript:void(0);" onclick="_openDialogSellerInfo(<?php echo $SHOW->getUserCreatedId();?>)"><?php echo $SELLER->getFirstName()." ".$SELLER->getLastName(); ?></a></td>
				<td><a href="<?php echo site_url("admin/dataman/show/bid/?show_id=".$SHOW->getId());?>"><?php echo "View $numberBidShow"; ?></a></td>
				<td><a href="javascript:void(0);" onclick="_openDialogShowInfo(<?php echo $SHOW->getId();?>)"><?php echo $SHOW->getName(); ?></a></td>
				<td><?php echo $SHOW->getArtist(); ?></td>
				<td><?php echo sbxDateFormat($item->date_bid,'d-M-Y'); ?></td>
			</tr>
			<?php endforeach; ?>
		</tbody>
		<tfoot>
			<tr>
				<td colspan="7">
					<div class="inner"><?php echo $items['pagination']['links']; ?></div>
				</td>
			</tr>
		</tfoot>
	</table>


